import requests


class TpShopRegister:

    def verify_code_get(self):
        self.sess = requests.Session()
        self.sess.get(url="http://hmshop-test.itheima.net/index.php?"
                          "m=Home&c=User&a=verify&type=user_reg")

    def resp_register(self, req_data):
        resp = self.sess.post(url="http://hmshop-test.itheima.net/Home/User/reg.html",
                              data=req_data)
        return resp


if __name__ == '__main__':
    tpshop = TpShopRegister()
    tpshop.verify_code_get()
    data_tp = {"scene": "1",
               "username": "13124780254",
               "verify_code": "8888",
               "password": "123456",
               "password2": "123456"}
    print(tpshop.resp_register(data_tp).json())
